<?php

require_once "DBs.php";

//Backend is universal database - logic backend and trys to hold all that it needs 
//Extend it to your class for use

class Base
{
	var $msgs;
	var $validationNotes;
	static protected $instance;
	
	//BACKEND PART
	
	function Base()
	{
		$this->validationNotes = array();
		$this->msgs = array();
	}
	
	function _addMsg($msg, $class)
	//add msg to msgs array
	{
		$this->msgs[] = array($msg, $class);
	}

	/*function _log($type, $msg)
	//type: error, event, warning
	{
		DBs::insertRow($this->db, $GLOALS['t']['_log'], array(Null, '#noQuote#NOW()', $type, $msg));
	}*/

	//FRONT PART
	
  function _show_msgs($class='')
  //display all msgs you have (if any), you can filter them by class
  {
  	$out = '';
  	if (count($this->msgs))
  	{
	  	$out = "<div class='msgs'><h1 style='color: grey;'>Messages</h1><ul>\n";
	  	foreach($this->msgs as $msg)
	  	{
	  		if ($msg[1] == $class || $class == '')
	  		{
	  			$out .= "<li class='$msg[1]'>$msg[0]</li>\n";
	  		}
	  	}
	  	$out .= "</ul></div>\n";
	  }
		return $out;
  }
}


?>